import request from '../../util/request'


export default {

    createCollection(data) {
        return request({
            method: "POST",
            url: "collections",
            data
        })
    },

    deleteCollection(id) {
        return request({
            method: 'DELETE',
            url: `collections/${id}`,
        })
    },

    deleteCollectionByArticleId(id) {
        return request({
            method: 'DELETE',
            url: `collections/article/${id}`,
        })
    },

    getCollectionCategory() {
        return request({
            url: "collection-categories",
        })
    },

    getCollectionCategoryById(categoryId) {
        return request({
            url: `collection-categories/${categoryId}`,
        })
    },


    createCollectionCategory(data) {
        return request({
            method: 'POST',
            data,
            url: "collection-categories",
        })
    },


    deleteCollectionCategory(id) {
        return request({
            method: 'DELETE',
            url: `collection-categories/${id}`,
        })
    }
}
